
#ifndef   __INPUTS_H_
#define   __INPUTS_H_


/* #define   PIN_INP_1		RG0 */
/* //#define   PIN_INP_2		RF1	 */
/* #define   PIN_INP_2		RF6	 */
/* #define   PIN_INP_3		RF2 */
/* #define   PIN_INP_4		RF3 */
/* #define   PIN_INP_5		RF4 */

/* #define   PIN_INP_1		RA0 */
/* #define   PIN_INP_2		RB0	 */


#if defined(APP_CAR_PETROL_BLOCKING)

#define   PIN_INP_1		RF3
#define   PIN_INP_2		RF4	
#define   PIN_INP_3		RA1
#define   PIN_INP_4		RB1
#define   PIN_INP_5		RB3
#define   PIN_INP_6		RF1

#define   PIN_INP_7		RA3
#define   PIN_INP_8		RB2
#define   PIN_INP_9		RG0

#else
#define   PIN_INP_1		RA0
#define   PIN_INP_2		RB0	
#define   PIN_INP_3		RA1
#define   PIN_INP_4		RB1
#define   PIN_INP_5		RB3
#define   PIN_INP_6		RA2

#define   PIN_INP_7		RA3
#define   PIN_INP_8		RB2
#define   PIN_INP_9		RG0
#endif

#define   PIN_INP_CONFIG_PORT_A		0b00001111
#define   PIN_INP_CONFIG_PORT_B		0b00001111
#define   PIN_INP_CONFIG_PORT_F		0b00111010
#define   PIN_INP_CONFIG_PORT_G		0b00000001

/* #define   PIN_INP_1		RF3 */
/* #define   PIN_INP_2		RF4 */
/* #define   PIN_INP_3		RA1 */
/* #define   PIN_INP_4		RB1 */
/* #define   PIN_INP_5		RB3 */
/* #define   PIN_INP_6		RF5	 */


/* #define   PIN_INP_CONFIG_PORT_A		0b00000011		 */
/* #define   PIN_INP_CONFIG_PORT_B		0b00001011		 */
/* #define   PIN_INP_CONFIG_PORT_F		0b00111000 */



/* state of inputs */
typedef struct 
{
	unsigned 	INP_1		 	: 	1;
	unsigned 	INP_2   	 	: 	1;	    	
	unsigned 	INP_3   	 	: 	1;
	unsigned 	INP_4   	 	: 	1;
	unsigned 	INP_5   	 	: 	1;
	unsigned 	INP_6   	 	: 	1;
	unsigned 	INP_7   	 	: 	1;
	unsigned 	INP_8		 	: 	1;
	unsigned 	INP_9		 	: 	1;
	unsigned 	INP_10		: 	1;
	unsigned 	INP_11		: 	1;
	unsigned 	INP_12		: 	1;
	unsigned 	INP_13		: 	1;
	unsigned 	INP_14		: 	1;
	unsigned 	INP_15		: 	1;
	unsigned 	INP_16		: 	1;
	
}INPUTS_STATE;

/* enum */
/* { */
/* 	INP_0_DOWN = 2, */
/* 	INP_0_UP, */

/* 	INP_1_DOWN, */
/* 	INP_1_UP, */

/* 	INP_2_DOWN, */
/* 	INP_2_UP, */

/* 	INP_3_DOWN, */
/* 	INP_3_UP, */

/* 	INP_4_DOWN, */
/* 	INP_4_UP, */
	
/* 	INP_AMOUNT */
/* }; */


 #define   INPUT_UP 		0x80000000
 #define   INPUT_1_UP	0x80000001			  /* if BIT31 is SET - INPUT was UP */
 #define   INPUT_2_UP	0x80000002
 #define   INPUT_3_UP	0x80000003
 #define   INPUT_4_UP	0x80000004
 #define   INPUT_5_UP	0x80000005
 #define   INPUT_6_UP	0x80000006						  /* 134 */
 #define   INPUT_7_UP	0x80000007
 #define   INPUT_8_UP	0x80000008
 #define   INPUT_9_UP	0x80000009

/* enum */
/* {										   */
/* 	INPUT_UP = (unsigned long)0x80000000, */
/* 	INPUT_1_UP,			  /\* if BIT31 is SET - INPUT was UP *\/ */
/* 	INPUT_2_UP, */
/* 	INPUT_3_UP, */
/* 	INPUT_4_UP, */
/* 	INPUT_5_UP, */
/* 	INPUT_6_UP,						  /\* 134 *\/ */
	
/* 	INPUT_7_UP, */
/* 	INPUT_8_UP=(unsigned long)0x80000008L, */
/* 	INPUT_9_UP */
/* }; */

enum
{
	INPUT_DOWN = 0x00000000,
	INPUT_1_DOWN,			/* if BIT31 is CLEAR - INPUT was DOWN */
	INPUT_2_DOWN,
	INPUT_3_DOWN,
	INPUT_4_DOWN,
	INPUT_5_DOWN,
	INPUT_6_DOWN,					  /* RF1 */
	
	INPUT_7_DOWN,
	INPUT_8_DOWN,
	INPUT_9_DOWN
};




//extern INPUTS near Inputs_State;			  /* State of keys */
extern unsigned long near InputsEvent;		  /* Name of key which was pressed  */
extern INPUTS_STATE InputsState;			  /* events of HOOKSET and SIM_SWITCH */

void Drive_Inputs ( void );
void Inputs_Init ( void );

#endif



